//
//  YHOptionTableViewItem.h
//  ScriptKill
//
//  Created by 林宁宁 on 2021/4/28.
//  Copyright © 2021 优智汇. All rights reserved.
//

#import <YHBase/YHBaseObject.h>
#import <YHBase/YHBaseTableViewCell.h>
#import "YHOptionTableViewLayout.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, YHOptionTableViewItemCellType) {
    YHOptionDefaultItemCellType_Normal = 0,
    
    YHOptionDefaultItemCellType_ImageList = 1000,
};

@class YHOptionTableViewSubContent;

@interface YHOptionTableViewItem : YHBaseObject

/// 默认 YHOptionTableViewItemCellType
@property (assign, nonatomic) NSInteger cellType;

@property (assign, nonatomic) Class cellClass;
@property (copy, nonatomic) NSString * cellIdentify;

@property (copy, nonatomic) NSString * optionID;

/// 关联外部的model信息
@property (retain, nonatomic) id linkInfo;

/// 是必填的 默认YES
@property (assign, nonatomic) BOOL isRequire;
/// 值变化之后 去自动刷新表格数据
@property (assign, nonatomic) BOOL changeShouldReload;

/// MARK:  值变化tableview就会刷新
///  内容
@property (copy, nonatomic) NSString * content;
/// 复选框选中的菜单信息 如果是数组通过 , 分开
@property (copy, nonatomic) NSString * pickerContents;

/// 左侧显示的内容
@property (retain, nonatomic) YHOptionTableViewSubContent * leftContent;

/// 右侧显示的内容
@property (retain, nonatomic) YHOptionTableViewSubContent * rightContent;

/// MARK: -

/// 布局设置
@property (retain, nonatomic) YHOptionTableViewLayout * layout;

/// cell显示
@property (copy, nonatomic) void(^cellShowBlock)(__kindof YHBaseTableViewCell * cell,__kindof YHOptionTableViewItem * passItem);
/// cell点击
@property (copy, nonatomic) void(^cellClickBlock)(NSIndexPath * indexPath, YHOptionTableViewItem * passItem);
/// cell 右侧视图点击
@property (copy, nonatomic) void(^cellRightClickBlock)(NSIndexPath * indexPath, YHOptionTableViewItem * passItem, YHOptionCellRightShowType showType, YHOptionTableViewSubContent * content);

/// cell clean
@property (copy, nonatomic) void(^cellCleanBlock)(NSIndexPath * indexPath, YHOptionTableViewItem * passItem);
/// 高度计算
@property (copy, nonatomic) CGFloat(^cellHeightCalculationBlock)(NSIndexPath * indexPath,YHOptionTableViewItem * passItem);


- (void)layoutConfig:(void(^)(YHOptionTableViewLayout * passLayout))config;

/// 判断是否满足条件 不满足弹窗提示
- (BOOL)isAviableToHint;

@end


/// 左右两边的内容
@interface YHOptionTableViewSubContent : YHBaseObject

/// 图片
@property (copy, nonatomic) NSString * _Nullable imageURL;

/// switch 开关
@property (assign, nonatomic) NSInteger isOn;

/// 标题富文本
@property (copy, nonatomic) NSString * _Nullable title;
@property (retain, nonatomic) NSAttributedString * _Nullable attibutedTitle;

- (void)clean;

- (BOOL)isNull;

@end


NS_ASSUME_NONNULL_END
